import React, { Component } from 'react';
import '../Nav/Nav.scss'
import  service from '../../api/index'


class Nav extends Component {
    constructor(props){
      super(props)
      this.state = {
        Navlist:[],
      }
    }
    async componentDidMount(){
        var res = await service.pro.index_catelist()
        // console.log(res.data.data);
        this.setState({Navlist:res.data.data})
    }
    render() {
        return (
            <div className='nav'>
                {
                    this.state.Navlist.map((item,index)=>{
                        return (
                            <div  className='navlist' key={index}>
                              <img src={item.imgurl} alt="" />
                              <span>{item.title}</span>
                            </div>
                        )
                    })
                }
            </div>
        );
    }
}

export default Nav;